namespace OpenWaves.HtmlEncoding
{
    public class RawTextToken : HtmlToken
    {
        private readonly string text;

        public RawTextToken(string text, int startIndex, int endIndex)
            : base(startIndex, endIndex)
        {
            this.text = text;
        }

        protected override void AddMissingTokens(string html)
        {
        }

        public override void Render(IHtmlWriter writer)
        {
            writer.WriteText(this.text.Substring(StartIndex, EndIndex - StartIndex + 1));
        }
    }
}